<template>
    <!--ASN明细-->
    <div id="AsnDetails">
        <v-details :detailData="data.detailData" :inputConfig="inputConfig" :rules="rules"></v-details>
    </div>
</template>

<script>

    import details from 'commons/Detail'
    import baseMixin from "@/mixins/BaseMixin";

    export default {
        name: "AsnDetails",
        mixins: [baseMixin],
        props: {
            data: {
                type: Object
            }
        },
        data() {
            return {
                addflag: true,
                rules: {},
            }
        },
        computed: {
            inputConfig() {
                return [
                    [
                        {
                            type: "select",
                            label: "至货币",
                            props: "to_curr_code",
                            options: this.getOptions("queryCurrencyDetailCode"),
                            disabled: this.addflag
                        },
                        {
                            type: "date",
                            label: "交换日期",
                            props: "exchange_date",
                        },
                        {
                            type: "input",
                            label: "兑换率",
                            props: "exchange_rate",
                        },
                    ]
                ]
            }
        },
        methods: {},
        mounted() {
            if (Object.keys(this.$store.state.skip).length !== 0) {
                let data = this.$store.state.skip;
                if(data.detailListFlag){
                    this.addflag = false;
                }else if(data.newFlag){
                    this.addflag = false;
                }
            }else if (this.$store.state.newFlag) {
                this.addflag = false;
            } else if (this.$store.state.detailsNew) {
                this.addflag = false;
            }
        },
        watch: {},
        components: {
            'v-details': details
        }
    }
</script>

<style scoped>

</style>
